/* iot-platform/assets/css/visual.css */

/* ---
   本文件包含“视联网”模块的专属样式。
   - visual-list.html: 左侧筛选 + 右侧表格布局
   - visual-detail.html: 两栏沉浸式详情页布局 (主监控面板 + 右侧控制信息面板)
   - 以及以上页面中所有特殊组件的样式。
--- */


/* --- 1. 视频设备列表页 (visual-list.html) 样式 --- */

/* 页面主内容区内的两栏包裹容器 */
.visual-list-wrapper {
    display: flex;
    gap: 24px;
    height: 100%;
}

/* 左侧筛选面板 */
.left-filter-panel {
    width: 280px;
    flex-shrink: 0;
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.left-filter-panel .search-box {
    margin-bottom: 20px;
    position: relative;
}
.left-filter-panel .search-box input {
    width: 100%;
}
.left-filter-panel .search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8c8c8c;
    cursor: pointer;
}
.left-filter-panel .filter-tree {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}
.filter-tree .tree-item {
    padding: 8px 0;
}
.filter-tree .tree-item input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}
.filter-tree .tree-item label {
    cursor: pointer;
}

/* 右侧内容面板 (表格所在区域) */
.right-content-panel {
    flex-grow: 1;
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}


/* --- 2. 视频查看详情页 (visual-detail.html) 样式 --- */

/* 详情页的主内容区需要成为flex容器，以正确管理高度 */
.main-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px - 48px); /* 视口高度 - 头部 - 上下padding */
}

/* 详情页内容区的两栏网格布局 */
.visual-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px; /* 左侧自适应，右侧固定宽度 */
    gap: 24px;
    flex-grow: 1;
    overflow: hidden;
}

/* 主监控面板 (左侧大卡片) */
.main-monitor-panel {
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.main-monitor-panel .monitor-screen {
    flex-grow: 1;
    background-color: #000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

/* 右侧面板容器 */
.control-info-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 右侧面板内的卡片 (设备控制 & 告警记录) */
.control-box, .info-box {
    display: flex;
    flex-direction: column;
}
.control-box {
    flex-shrink: 0;
}
.info-box {
    flex-grow: 1;
    overflow: hidden; /* 防止内容溢出 */
}

/* 卡片内标题 */
.control-title, .info-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* 云台控制样式 */
.ptz-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: 120px;
    margin: 0 auto;
}
.ptz-controls button {
    width: 32px;
    height: 32px;
    border: 1px solid #d9d9d9;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.ptz-controls .center-btn {
    grid-column: 2;
    grid-row: 2;
    background-color: #f0f0f0;
}
.ptz-controls button:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.zoom-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.zoom-controls button {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.preset-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}
.preset-controls .preset-item {
    text-align: center;
}
.preset-controls .preset-item .icon {
    width: 40px;
    height: 40px;
    background: #f0f2f5;
    border-radius: 4px;
    margin: 0 auto 8px;
}
.preset-controls .preset-item span {
    font-size: 12px;
    color: #595959;
}

/* 告警记录样式 */
.alarm-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}
.alarm-stats .value {
    font-size: 24px;
    font-weight: bold;
    color: #f5222d;
}
.alarm-stats span {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 4px;
}

.alarm-record-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}
.alarm-record-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.alarm-record-item:last-child {
    border-bottom: none;
}
.alarm-record-item .icon {
    width: 20px;
    height: 20px;
    background: #f5222d;
    color: #fff;
    border-radius: 50%;
    margin-right: 12px;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    flex-shrink: 0;
}
.alarm-record-item .time {
    margin-left: auto;
    font-size: 12px;
    color: #8c8c8c;
    padding-left: 16px;
}